package com.base.storage.config;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Component
@ConfigurationProperties("oss.storage")
public class CloudStorageConfig implements  Serializable{
    private static final long serialVersionUID = 1L;

    //文件最大上传大小
    public static long FILE_MAX_SIZE = 1024 * 1024 * 10l;

    //过期时间 100年
    public static long FILE_EXPIRATION_TIME = 1000 * 3600 * 24 * 365 * 100;


    //类型 qiniuoss：七牛  alioss：阿里云  qcloud：腾讯云  local：服务器存储
    @Value("${methods:}")
    private String methods;

    //目标存储域名
    @Value("${dst-domain:}")
    private String dstDomain;

    //目标存储路径前缀
    @Value("${dst-prefix:}")
    private String dstPrefix;

    //目标存储ACCESS_KEY(七牛，腾讯SecretId，阿里云AccessId)
    @Value("${dst-accesskey:}")
    private String dstAccessKey;

    //目标存储SECRET_KEY(七牛，腾讯，阿里云访问密钥)
    @Value("${dst-secretkey:}")
    private String dstSecretKey;

    //目标存储空间名(七牛，腾讯，阿里云)
    @Value("${dst-bucketname:}")
    private String dstBucketName;

    //端点（阿里云EndPoint,腾讯云COS所属地区qcloudRegion）
    @Value("${endpoint:}")
    private String endPoint;

    //腾讯云AppId
    @Value("${qcloud-appid:}")
    private Integer qcloudAppId;

    //服务器存储
    @Value("${diskpath:}")
    private String diskPath;

    //本地存储代理服务器不能为空
    @Value("${proxy-server:}")
    private String proxyServer;

    @Value("${whitelist:}")
    private String[] whitelist;


    public String[] getWhitelist() {
        return whitelist;
    }

    public void setWhiteist(String[] whitelist) {
        this.whitelist = whitelist;
    }

    public String getMethods() {
        return methods;
    }

    public Integer getQcloudAppId() {
        return qcloudAppId;
    }

    public String getDstAccessKey() {
        return dstAccessKey;
    }

    public String getEndPoint() {
        return endPoint;
    }

    public String getDstBucketName() {
        return dstBucketName;
    }

    public String getDstDomain() {
        return dstDomain;
    }

    public String getDiskPath() {
        return diskPath;
    }

    public String getDstPrefix() {
        return dstPrefix;
    }

    public String getDstSecretKey() {
        return dstSecretKey;
    }

    public String getProxyServer() {
        return proxyServer;
    }

    public void setMethods(String methods) {
        this.methods = methods;
    }

    public void setEndPoint(String endPoint) {
        this.endPoint = endPoint;
    }

    public void setDiskPath(String diskPath) {
        this.diskPath = diskPath;
    }

    public void setDstAccessKey(String dstAccessKey) {
        this.dstAccessKey = dstAccessKey;
    }

    public void setDstBucketName(String dstBucketName) {
        this.dstBucketName = dstBucketName;
    }

    public void setDstDomain(String dstDomain) {
        this.dstDomain = dstDomain;
    }

    public void setDstPrefix(String dstPrefix) {
        this.dstPrefix = dstPrefix;
    }

    public void setDstSecretKey(String dstSecretKey) {
        this.dstSecretKey = dstSecretKey;
    }

    public void setProxyServer(String proxyServer) {
        this.proxyServer = proxyServer;
    }

    public void setQcloudAppId(Integer qcloudAppId) {
        this.qcloudAppId = qcloudAppId;
    }

}
